class Book(val bookname:String,val writer:String){
  def info(){
       println("your Bookname is"+bookname+"writer is"+writer)
}
}
object Book{
              def apply(bookname:String,writer:String)={
                    println("calling apply")
                    new Book(bookname,writer)
}
              def unapply(b:Book):Option[(String,String)]={
                    println("calling unapply")
                    Some(b.bookname,b.writer)
}
}
object Test{
     def main (args:Array[String]){
           var Book(bookname,writer)=Book("C++","mike")
           println("your borrow bookname:"+bookname+"\nwriter:"+writer)
}
}

